from langchain_community.vectorstores import Qdrant
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnableParallel, RunnablePassthrough
from langchain_community.chat_models import ErnieBotChat
from langchain_community.embeddings import ErnieEmbeddings
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.document_loaders import TextLoader, PyPDFLoader
from langchain_community.llms import Tongyi
import json
import warnings
warnings.filterwarnings('ignore')

# 读取API Key
with open(r'd:\code\vscode\.Python\taidi\code_tadi\ERNIE_config.json') as f:
    key = f.read()
    api_key = json.loads(key)

# 使用通义千问API
DASHSCOPE_API_KEY = api_key['DASHSCOPE_API_KEY'] # 阿里通义千问模型DASHSCOPE_API_KEY